package com.ruoyi.system.service.impl;

import com.ruoyi.system.domain.BaseAndGroup;
import com.ruoyi.system.domain.UserBaseGroup;
import com.ruoyi.system.domain.UserVisualBase;
import com.ruoyi.system.mapper.UserBaseGroupMapper;
import com.ruoyi.system.mapper.UserVisualBaseMapper;
import com.ruoyi.system.service.IDataLoadService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class DataLoadServiceImpl implements IDataLoadService {

    @Autowired
    private UserVisualBaseMapper userVisualBaseMapper;
    @Autowired
    private UserBaseGroupMapper userBaseGroupMapper;

    @Override
    @Transactional
    public List<Object> showBaseData(BaseAndGroup baseAndGroup) {
        List<Object> list = new ArrayList<Object>();
        List<UserVisualBase> BaseAndGroup2 = userVisualBaseMapper.selectUserVisualBaseListByUserId(baseAndGroup);
        List<UserVisualBase> BaseAndGroup1 = userBaseGroupMapper.selectUserBaseGroupListByUserId(baseAndGroup);
        list.addAll(BaseAndGroup1);
        list.addAll(BaseAndGroup2);

        return list;
    }

    @Override
    public int addBaseGroup(UserBaseGroup userBaseGroup) {
        return userBaseGroupMapper.addBaseGroup(userBaseGroup);
    }
}
